import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useMenuIdStore = defineStore(
  'menuId',
  () => {
    const menuId = ref<string | null>(null)
    const setMenuId = (newMenuId: string) => {
      menuId.value = newMenuId
    }
    const removeMenuId = () => {
      menuId.value = null
    }
    return {
      menuId,
      setMenuId,
      removeMenuId,
    }
  },
  {
    persist: {
      storage: localStorage,
    },
  },
)
